if not pattern then pattern = {} end

if not pattern.ticks then


dofile (ScriptsRootPath .. "lib\\lib.lua")
dofile (ScriptsRootPath .. "lib\\ticks.lua")
dofile (ScriptsRootPath .. "processor\\saver.lua")

pattern.ticks = {}

dofile (ScriptsRootPath .. "patterns\\ticks_pressure.lua")
dofile (ScriptsRootPath .. "patterns\\ticks_markets.lua")
dofile (ScriptsRootPath .. "patterns\\ticks_ice.lua")

for k, v in pairs(pattern.ticks) do
	if v.OnTick then
		table.sinsert(ticks.OnTick, v.OnTick)
	end
end

function pattern.ticks:SaveLabel(datetime, price)
	if not datetime then return end
	if price and not datetime.price__ then datetime.price__ = price end
	local file = lib.path.labels .. "ticks." .. lib:FormatDate(lib.tick_date)
	if file ~= self.labels_file then
		self.labels_file = file
		if lib.tick_date then lib:remove(file) end
		processor:InitSharedSaver("label.tick", file)
	end
	
	local str = lib:toline(datetime)
	processor:save("label.tick", str)
end

end -- of file


